﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Data;
using Smallerp.Contracts.DataContracts;

namespace Smallerp.Contracts
{
    [ServiceContract]
    public interface IOperateDB
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="inSql"></param>
        /// <returns></returns>
        [OperationContract]
        DataTable QueryDataTable(string inSql);
        [OperationContract]
        int ExecuteNonQuery(string sqlstr);
        [OperationContract]
        Object ExecuteScalar(string sqlstr);
        [OperationContract]
        int AddOrderToDB(OrderViewDCT inView);
        /// <summary>
        /// 插入大板
        /// </summary>
        /// <param name="PicList"></param>
        /// <param name="tb_paperTemplate_Info"></param>
        /// <param name="printer_Info"></param>
        /// <param name="wasteRate"></param>
        /// <param name="realBoardLength"></param>
        /// <param name="isNeedAddNewTemplate"></param>
        /// <param name="BoardFolderPath"></param>
        /// <returns></returns>
        [OperationContract]
        int CreateBoard(List<PhotoInfo_PBDCT> PicList, BoardTemplate_DCT tb_paperTemplate_Info, PrinterDCT printer_Info, float wasteRate, int realBoardLength, bool isNeedAddNewTemplate, string BoardFolderPath,int boardType);
        [OperationContract]
        int CreateBoard2(List<PhotoInfo_PBDCT> PicList, BoardTemplate_DCT tb_paperTemplate_Info, PrinterDCT printer_Info, float wasteRate, int realBoardLength, bool isNeedAddNewTemplate, string BoardFolderPath,bool isSure);
        [OperationContract]
        int CopyPhoto(List<PhotoInfo_PBDCT> SelectPhotoList, int AddNum);
        [OperationContract]
        int CopyOrder(List<OrderInfo_PBDCT> SelectOrderList, int AddNum);
        [OperationContract]
        int DeletePhotos(List<PhotoInfo_PBDCT> SelectPhotoList);
        [OperationContract]
        int DeleteOrders(List<OrderInfo_PBDCT> SelectPhotoList);
        [OperationContract]
        int ModifyOrder(OrderInfo_PBDCT modifyOI);
        [OperationContract]
        List<PaperFaceDCT> GetAllPaperFace();
        [OperationContract]
        List<PaperTypeDCT> GetAllPaperType();
        [OperationContract]
        List<PrinterDCT> GetAllPrinters();
        [OperationContract]
        int DeleteBoard(int boardid);
        [OperationContract]
        int RePrint(int Boardid,int paperid);
        [OperationContract]
        DataTable ChangerPaper(int printerid, int newPaperid);
        [OperationContract]
        int AssinGrid(int inPhotoID, out string OutGridName, out GridInfo_GridDCT outGridInfo_Grid, out int outGridID, int inSubAreaID);
        [OperationContract]
        int ForcePrintGrid(GridInfo_GridDCT inGGD);
        [OperationContract]
        int ClearSelectedGrid(GridInfo_GridDCT inGrid);
        [OperationContract]
        int PriorityPhoto(List<GridInfo_GridDCT> infoGrids, int inNum);
        [OperationContract]
        int CreateInnerReturn(List<InnerReturn_InfoDCT> CurrPhotoList, out Dictionary<int, int> outPhotoDict);
        [OperationContract]
        int ChangeWaitSureToWaitMake();
        [OperationContract]
        int DeleteBoards(List<int> inList);
        [OperationContract]
        List<DisPalyBoardInfoDCT> GetUnSureBoardInfo();
        [OperationContract]
        List<BoardInfoDCT> GetBoardInfo(string BoardName, DateTime inSTTime, DateTime inEndTime);
        [OperationContract]
        bool GetIsClearPhoto();
        [OperationContract]
        int AddOrderToDB2(OrderViewDCT inView, int Model);
        [OperationContract]
        int CombinBoard(List<PhotoInfo_PBDCT> PicList, int transX, int inNewLength, int InOldBoardid, PrinterDCT printer_Info, BoardTemplate_DCT tb_paperTemplate_Info);
        [OperationContract]
        string GetFileSavepath();
        [OperationContract]
        int AddOrderToDB2MoveBefore(OrderViewDCT inView, int Model);
              
        [OperationContract]
        bool AddDXFContent(int orderid, string dxfContent,byte[] dexContent);
           [OperationContract]
        bool AddPhotoDXFContent(int photoId, string dxfpath, byte[] dexContent);

         [OperationContract]
        PhotoInfo_PBDCT GetPhotoInfo(int photoId);
           

    }
}
